function getAPI(port,idata){
  console.log("input",idata)
  var mdata ={}
  mdata['port']=port;
  for(var key  in idata)
  {
    mdata[key]=idata[key]
  }
  console.log("input",mdata)
  return new Promise(function (resolve, reject) {
    wx.request({
      method: 'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded',
        'chartset': 'utf-8'
      },
      url: 'https://fdxt.xyz:5050', //服务器API的url
      //如http://localhost:8989/wxAPI/query.do?searchStr=斗破苍穹
      data: {
        port:JSON.stringify('offline_module_list'),
        userID:JSON.stringify('53a83bec-bab1-11eb-8c6a-525400b647a3')
      },
      header: {
        'content-type': 'application/json'
      },
      success: function(res){
        resolve(res);
      },
      fail: () => {
        reject("系统异常，请重试！")
      }
    })
  })
}
module.exports={
  getAPI:getAPI
}
